<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../css/recipe.css" />
<script type="text/javascript" src="../js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="../js/recipe.js"></script>
<script>
	
</script>
<title>Insert title here</title>
</head>
<%-- <c:if test="${pass==null}">
	<c:redirect url="http://localhost:8080/SSMFrame/login.htm" />
</c:if> --%>
<body>
	<table>

		<tr>
			<td width="220px">
				<div class="menu">

					<a href="http://localhost:8080/SSMFrame/jsp/home.jsp">首页</a><br />
					<br /> <a href="http://localhost:8080/SSMFrame/jsp/BMI_Number.jsp">身高体重指数</a><br />
					<br /> <a href="http://localhost:8080/SSMFrame/jsp/recipe.jsp">食谱分析</a><br />
					<br /> <a
						href="http://localhost:8080/SSMFrame/jsp/energyCount.jsp">能量收</a><a
						href="http://localhost:8080/SSMFrame/jsp/energyCount.jsp">支</a><br />
					<br /> <a href="http://localhost:8080/SSMFrame/exit.do">退出登录</a>

				</div>
				<span style="width:150px">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;</span>
			</td>
			<td width="1200px">
				<h2>请选择您的食谱组成</h2>
				<h4>注:为了更符合实际,质量数可根据食物品质酌情增减</h4>
				<form id="eatForm" onsubmit="return checkRecipe(this)">
					<table>

						<tr>
							<td>主食:<select name="staple_food">
									<option value="大米" selected="selected">大米</option>
									<option value="面条">面条</option>
									<option value="馒头">馒头</option>
									<option value="小米">马铃薯</option>
							</select></td>
							<td><input type="text" id="count1" name="mainCount"
								value="0">g</td>
						<tr>
							<td>肉类:<select name="meat">
									<option value="猪肉">猪肉</option>
									<option value="2">狗肉</option>
									<option value="3">牛肉</option>
									<option value="4">羊肉</option>
									<option value="5">鸡肉</option>
									<option value="6">鱼肉</option>
									<option value="7">五花肉</option>
							</select>
							</td>
							<td><input type="text" name="meatCount" value="0">g</td>
						<tr>
							<td>蔬菜:<select name="leaf">
									<option value="白菜">白菜</option>
									<option value="空心菜">空心菜</option>
									<option value="8">油麦菜</option>
									<option value="7">韭菜</option>
									<option value="7">西兰花</option>
									<option value="7">白菜花</option>
									<option value="7">韭菜</option>
							</select></td>
							<td><input type="text" name="leafCount" value="0">g</td>
						<tr>
						<tr>
							<td>配菜:<select name="other">
									<option value="鸡蛋">鸡蛋</option>
									<option value="8">油麦菜</option>
									<option value="7">韭菜</option>
									<option value="8">白菜</option>
									<option value="7">西兰花</option>
									<option value="7">白菜花</option>
									<option value="7">韭菜</option>
							</select></td>
							<td><input type="text" name="otherCount" value="0">g</td>
						<tr>
							<td>水果:<select name="melon">
									<option value="苹果">苹果</option>
									<option value="2">猕猴桃</option>
									<option value="3">南瓜</option>
									<option value="4">丝瓜</option>
									<option value="5">黄瓜</option>
									<option value="6">菜瓜</option>
									<option value="7">甜椒</option>
									<option value="8">茄子</option>
							</select></td>
							<td><input type="text" name="melonCount" value="0">g</td>
						</tr>
						<tr>
						</tr>

					</table>
				</form>
				<button onclick="formRecipe()">一日三餐</button>
				<br>
				<button id="reset">重置</button><br />
				<table id="threeDine" class="page" style="border: 1px solid;">

					<tr>
						<th>&nbsp;</th>
						<th>标记</th>
						<th>能量(kJ)</th>
						<th>蛋白质(g)</th>
						<th>脂肪(g)</th>
						<th>糖分(g)</th>
						<th>钙(g)</th>
						<th>铁(g)</th>
						<th>维生素A(mg)</th>
						<th>维生素B1(mg)</th>
						<th>维生素B2(mg)</th>
						<th>维生素C(mg)</th>
						<th>维生素D(mg)</th>
						<th>维生素E</th>
					</tr>
					<tr>
						<td>每日需求</td>
						<td>&nbsp;</td>
						<td>${pass.getWeight()*0.06*240*1.8 }</td>
						<td>50</td>
						<td>250-350</td>
						<td>12-20</td>
						<td>8</td>
						<td>1</td>
						<td>0.8-1.0</td>
						<td>1.2-1.4</td>
						<td>1</td>
						<td>75</td>
						<td>0.005</td>
						<td>140-210</td>
					</tr>
					<tr>
						<td>早餐</td>
						<td ></td>
						<td class="energy"></td>
						<td class="protein"></td>
						<td class="fat"></td>
						<td class="sugar"></td>
						<td class="ca"></td>
						<td class="fe"></td>
						<td class="va"></td>
						<td class="vb1"></td>
						<td class="vb2"></td>
						<td class="vc"></td>
						<td class="vd"></td>
						<td class="ve"></td>
					</tr>
					<tr>
						<td>午餐</td>
						<td></td>
						<td class="energy"></td>
						<td class="protein"></td>
						<td class="fat"></td>
						<td class="sugar"></td>
						<td class="ca"></td>
						<td class="fe"></td>
						<td class="va"></td>
						<td class="vb1"></td>
						<td class="vb2"></td>
						<td class="vc"></td>
						<td class="vd"></td>
						<td class="ve"></td>
					</tr>
					<tr>
						<td>晚餐</td>
						<td ></td>
						<td class="energy"></td>
						<td class="protein"></td>
						<td class="fat"></td>
						<td class="sugar"></td>
						<td class="ca"></td>
						<td class="fe"></td>
						<td class="va"></td>
						<td class="vb1"></td>
						<td class="vb2"></td>
						<td class="vc"></td>
						<td class="vd"></td>
						<td class="ve"></td>
					</tr>
					<tr>
						<td>合计</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
				</table> <br> <br>
				<button id="self-menu">自定义(点击重置):</button> <br> 输入食品名称:<input
				id="keyWord" type="text">
				<button onclick="searchFood()">搜索</button>
				<p style="color:gray">(输入ALL三个字母列出全部食品清单)</p>
				<p id="result">结果如下:</p>
				<form id="foodForm">
					<table class="page">
						<thead id="title">
							<tr>
								<th>ID</th>
								<th>名称/100g</th>
								<th>能量(kJ)</th>
								<th>蛋白质(g)</th>
								<th>脂肪(g)</th>
								<th>糖分(g)</th>
								<th>钙(g)</th>
								<th>铁(g)</th>
								<th>维生素A(mg)</th>
								<th>维生素B1(mg)</th>
								<th>维生素B2(mg)</th>
								<th>维生素C(mg)</th>
								<th>维生素D(mg)</th>
								<th>维生素E</th>
								<th>食用质量(g)</th>
							</tr>
						</thead>
						<tbody id="food">
						</tbody>
					</table>
				</form> <br>
				<button style="position: relative; left: 40%;" onclick="calculate()">计算</button>
				<p></p>
				<p></p>
				<h3>保存食谱</h3>
				<div id="setRecipe">
				食谱名:<input value="未命名"><br>
				描述:&emsp;<textarea rows="1" cols="66"></textarea>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				<div>食物:<input>&emsp;质量(g):<input></div>
				</div>
				<button onclick="addFood()">更多>></button>
<button onclick="saveRecipe()">保存食谱</button>

			</td>
		</tr>
	</table>
	<p></p>
	<p></p>
	<p></p>
</body>
</html>